package com.xgimi.open.skill.datamanager.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.xgimi.commons.base.Result;
import com.xgimi.open.skill.datamanager.biz.service.WordStockBizService;
import com.xgimi.open.skill.datamanager.service.api.WordStockRpcService;
import com.xgimi.open.skill.datamanager.service.request.BatchWordStockReqDTO;
import com.xgimi.open.skill.datamanager.service.request.EntryHandleReqDTO;
import com.xgimi.open.skill.datamanager.service.request.WordStockReqDTO;
import com.xgimi.open.skill.datamanager.service.response.WordEntryDTO;
import com.xgimi.open.skill.datamanager.service.response.WordStockRespDTO;
import com.xgimi.open.skill.datamanager.service.response.WordStockRespDTO2;
import com.xgimi.open.skill.datamanager.service.response.page.PageResult;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author coderzpw.zhang
 * @version 1.0
 * @description 描述
 * @date 2023/3/3 14:31
 */
@Service
public class WordStockRpcServiceImpl implements WordStockRpcService {

    @Autowired
    private WordStockBizService wordStockBizService;

    @Override
    public Result<Boolean> addWordStock(WordStockReqDTO wordStockReqDTO) {
        Boolean ret = wordStockBizService.addWordStock(wordStockReqDTO);
        return new Result<>(ret);
    }

    @Override
    public Result<Boolean> batchCreate(BatchWordStockReqDTO batchWordStockReqDTO) {
        Boolean ret = wordStockBizService.batchCreate(batchWordStockReqDTO);
        return new Result<>(ret);
    }

    @Override
    public Result<List<WordStockRespDTO2>> list(WordStockReqDTO wordStockReqDTO) {
        List<WordStockRespDTO2> result = wordStockBizService.list(wordStockReqDTO);
        return new Result<>(result);
    }

    @Override
    public Result<List<WordStockRespDTO>> listBySkillVid(Long skillVid) {
        List<WordStockRespDTO> result = wordStockBizService.listBySkillVid(skillVid);
        return new Result<>(result);
    }

    @Override
    public Result<WordStockRespDTO> queryById(Long id) {
        WordStockRespDTO ret = wordStockBizService.queryById(id);
        return new Result<>(ret);
    }

    @Override
    public Result<List<WordEntryDTO>> queryById2(Long id, String value) {
        List<WordEntryDTO> ret = wordStockBizService.queryById2(id, value);
        return new Result<>(ret);
    }

    @Override
    public Result<PageResult<WordStockRespDTO2>> pageQuery(WordStockReqDTO wordStockReqDTO) {
        PageResult<WordStockRespDTO2> result = wordStockBizService.pageQuery(wordStockReqDTO);
        return new Result<>(result);
    }

    @Override
    public Result<Boolean> delete(WordStockReqDTO wordStockReqDTO) {
        Boolean ret = wordStockBizService.deleteWordStock(wordStockReqDTO);
        return new Result<>(ret);
    }

    @Override
    public Result<Boolean> update(WordStockReqDTO wordStockReqDTO) {
        Boolean ret = wordStockBizService.updateWordStock(wordStockReqDTO);
        return new Result<>(ret);
    }

    @Override
    public Result<Boolean> handleEntry(EntryHandleReqDTO entryHandleReqDTO) {
        Boolean ret = wordStockBizService.handleEntry(entryHandleReqDTO);
        return new Result<>(ret);
    }
}
